package com.maxmlr.framework.mybatisplus.mapper;

import com.google.common.collect.Maps;
import com.maxmlr.framework.mybatisplus.executor.ExecutorType;
import com.maxmlr.framework.test.User;

import java.util.Map;

/**
 * @ClassName MapperRegistory
 * @Description TODO
 * @Author maxiao
 * @Date 2020/3/23 下午2:54
 * @Version V1.0
 */
public class MapperRegistory {
    private static final Map<String, MapperData> methodSqlMapping = Maps.newConcurrentMap();


    public MapperRegistory() {
        methodSqlMapping.put("com.maxmlr.framework.test.TestMapper.selectByPrimaryKey",
                new MapperData("select id,name,age from user where id = %d", ExecutorType.SELECT, User.class));
    }

    public boolean containsKey(String methodName) {
        return methodSqlMapping.containsKey(methodName);
    }

    public MapperData get(String methodName) {
        return methodSqlMapping.get(methodName);
    }

}
